package edu.westga.cs.recommender.model.datatypes;

import java.util.LinkedList;

public class Item {
	//Fields
	/**
	 *  Full, proper name of the item.
	 */
	private String name;
	/**
	 * Type of the item.
	 */
	private String type;
	/**
	 *	Creator of the item. 
	 */
	private String creator;
	/**
	 * Publisher of the item.
	 */
	private String publisher;
	/**
	 * Year the item was published.
	 */
	private int year;
	/**
	 * Description of the item.
	 */
	private String description;
	/**
	 *  Stores the properties to examine for similarity.  Properties are not stored in any particular order. 
	 */
	private LinkedList<String> properties;
	
	//Constructor
	/**
	 * Builds a new item.
	 * name: Full, proper name of the item.
	 * properties: Properties of the new item IN A LIST.
	 */
	public Item(String name, String creator, String type, String publisher, int year, String description, LinkedList<String> properties) {
		this.name = name;
		this.creator = creator;
		this.type = type;
		this.publisher = publisher;
		this.year = year;
		this.description = description;
		this.properties = properties;
	}
	
	//Methods
	/**
	 * Gets the full name.
	 * @return The full name.
	 */
	public String getName() {
		String secure = this.name;
		return secure;
	}
	
	/**
	 * Returns the type of the item.
	 */
	public String getType() {
		String secure = this.type;
		return secure;
	}
	
	/**
	 * Returns the creator of the item.
	 */
	public String getCreator() {
		String secure = this.creator;
		return secure;
	}
	
	/**
	 * Gets the publisher of the item.
	 */
	public String getPublisher() {
		String secure = this.publisher;
		return secure;
	}
	
	/**
	 * Returns the year the item was published.
	 */
	public int getYear() {
		int secure = this.year;
		return secure;
	}
	
	/**
	 * Returns the description of the item.
	 */
	public String getDescription() {
		String secure = this.description;
		return secure;
	}
	
	/**
	 * Gets the full list of properties.
	 * @return The full list of properties.
	 */
	public LinkedList<String> getProperties() {
		return this.properties;
	}
	
	/**
	 * Adds a new property.
	 * @param newProperty The property to add.
	 */
	public void addToProperties(String newProperty) {
		this.properties.add(newProperty);
	}
	
	/**
	 * Removes a particular property.
	 * @param delProperty Property to remove.
	 */
	public void removeGivenProperty(String delProperty) {
		int killNum = this.properties.indexOf(delProperty);
		this.properties.remove(killNum);
	}
}
